package polymorphism_0914;

public class ShapeTest {
    public static void main(String[] args) {
        Rect rect=new Rect();
        Cycle cycle=new Cycle();
        Tran tran=new Tran();
        //形状的对象数组
        Shape[] shapes={new Cycle(),new Tran(),new Rect()};
        for (Shape i:shapes) {
            i.draw();
        }
    }
}
